class Total {
    val maps: MutableMap<String, MutableList<People>> = mutableMapOf()
    fun accept(people: People){
        if(maps.containsKey(people.pinyin[0].toString())){
            maps[people.pinyin[0].toString()]?.add(people)
        }else{
            maps[people.pinyin[0].toString()]= mutableListOf(people)
        }
    }
    fun printall(){
        val sortedKeys = maps.keys.sorted()
        for (key in sortedKeys) {
            println("$key")
            maps[key]?.sortBy { it.pinyin0 }
            maps[key]?.forEach { people ->
                println("${people.name}   ${people.pinyin}")
            }
        }
    }
}